
<script type="text/javascript" src="/um/umeditor.config.js"></script>
<script type="text/javascript" src="/um/umeditor.min.js"></script>
<link href="/um/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<div class="row">
<div class="row" >
	<div class="col-md-3 col-md-offset-8">
		<img src="/src/img/wz.png">
	</div>
</div>
<div class="row" style="background-color:rgb(245,247,250)">

<div class="col-md-3" style="border:solid 1px rgb(221,221,221)">
	<div class="row" style="background-color:rgb(249,249,249)">
		<div class="row">
			<img src="{$_SESSION['uid']|uidimage}" class="img-circle center-block" width="120px"  style="border:solid 1px rgb(221,221,221);padding:5px;margin-top:-60px" id="imgch">
			<input type="file" name="image" class="hide" id="change" accept="image/png,image/gif,image/jpg,image/jpeg">
		</div>
		<p class="text-center" style="font-size:25px">
			{$_SESSION['uid']|uidname}
		</p>
		

	</div>
	<div class="row" style="background-color:rgb(251,252,253);border:solid 1px rgb(221,221,221)">
		<p class="text-center">
			上次登入
			<br>
			IP：{$info['lastip']}
			<br>
			时间:{$info['lasttime']|date="Y-m-d H:i:s",###}

		</p>


	</div>
	<div class="row" style="background-color:rgb(249,249,249);border:solid 1px rgb(221,221,221)">
		<br>
		<p class="text-center">
			<a href="/index.php/User/change" class="btn btn-info">修改密码</a>
		</p>
		<p class="text-center">
			<span class="btn btn-warning" data-toggle="modal" data-target="#joininfo">登入历史</span>
		</p>




<!-- Modal -->
<div class="modal fade" id="joininfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">我的登入历史</h4>
      </div>
      <div class="modal-body">
      	<table class="table table-striped">
      		<tr>
      			<th>
      				登入时间
      			</th>
      			<th>
      				登入IP
      			</th>
      		</tr>
      		<?php $joininfo=json_decode($info['joininfo'],true) ?>
           	<volist name="joininfo" id="info">
           		<tr>
           			<td>
           				{$info[lasttime]|date="Y-m-d H:i:s",###}
           			</td>
           			<td>
           				{$info[lastip]}
           			</td>
           		</tr>
      		</volist>
      	</table>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>

      </div>
    </div>
  </div>
</div>


		<p class="text-center">
			<a href="/index.php/User/logout" class="btn btn-danger">注销登入</a>
		</p>

		<div class="text-center">
			<p >
				<a href="/index.php/User/index" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-open"> 投稿管理</span></a>
			</p>
			<p >
				<a href="/index.php/User/mark" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-folder-open"> 收藏夹</span></a>
			</p>
			<p>
				<a href="/index.php/User/" class="btn btn-link btn-lg"><span class="glyphicon glyphicon-comment"> 消息</span></a>
			</p>
		</div>


	</div>	
</div>
<div class="col-md-9" style="border:solid 1px rgb(221,221,221)">
	<div class="row" style="border:solid 1px rgb(221,221,221)">	
		<ul class="nav nav-pills">
			<li  class="active"><a href="/index.php/User/tx">消息</a></li>
			
		</ul>
	</div>
	<div class="row" style="margin:10px;background-color:rgb(255,255,255);border:solid 1px rgb(221,221,221);padding:15px">

		<div >
			<div class="row" style="margin:25px;">
				{$page}
			</div>
			<hr>
			<div class="row">
				<volist name="tx" id="to">
					<div class="row" style="margin:25px;">	
						<div class="row" style="border-bottom:dashed 1px rgb(220,220,220)">
							<span class="col-sm-11">
								{$to['pd']|pd} / <a href="/index.php/Index/post/pid/{$to['pid']}/p/{$to['page']}">{$to['title']}</a>
							</span>
							<span class="col-sm-1"><a href="/index.php/Index/post/pid/{$to['pid']}/p/{$to['page']}">查看</a></span>
						</div>
						<div class="row">
							<div class="row" style="margin:25px;background-color:rgb(255,255,238)">
								<p style="margin:10px">{$to['rid_1']['text']}</p>
								<p  style="margin:10px"><small>#{$to['rid_1']['num']} {$to['rid_1']['uid']|uidname}</small></p>
							</div>
							<div class="row" style="margin:25px;">
								<div class="col-sm-1">
									<a href=""><img src="{$to['rid_1']['uid']|uidimage}" width="50px"></a>	
								</div>
								<div class="col-sm-11">
									<p class="text-muted">
										#{$to['rid_2']['num']} {$to['rid_2']['uid']|uidname} 发布于{$to['rid_2']['time']|date="Y-m-d H:i",###} 
									</p>
									<p>
										{$to['rid_2']['text']}
									</p>
									
								</div>						
							</div>
						</div>
					</div>
					<hr>
				</volist>	
			</div>
			<hr>
			<div class="row" style="margin:25px;">
				{$page}
			</div>
			
		</div>


	</div>	
</div>
</div>
</div>



<script type="text/javascript">
	$("#image").click(function(){
		$("#btnimage").click();
	})	
	$("#btnimage").change(function(){
		file=this.files[0];
		var fr=new FileReader();
		fr.readAsDataURL(file);
		fr.onload=function(e){
			$("#up").attr("src",this.result);
		}
	})
	$("#imgch").click(function(){
		$("#change").click();
	})
	$("#change").change(function(){
		var fd=new FormData();
		fd.append("image",this.files['0']);
		$.ajax({
			url:"/index.php/User/image",
			data:fd,
			type:"POST",
			 processData: false,  // 告诉jQuery不要去处理发送的数据

             contentType: false,   // 告诉jQuery不要去设置Content-Type请求头
			success:function(data){
				location.reload();
			}
		})
	})

	$(".remove").mouseover(function(){
		var i=$(this).attr("value");
		$("#"+i).removeClass("hidden");
	})
	$(".remove").mouseout(function(){
		var i=$(this).attr("value");
		$("#"+i).addClass("hidden");
	})
	function rm(pid){
		//alert(pid);
		$.get(
			'/index.php/Post/mark/pid/'+pid,
			function(data){
				location.reload();
			}


			)
	}
</script>
